﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>试卷-选择题</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
    <link rel="stylesheet" type="text/css" href="/View_Mobile/UI/KSGL/css/style.css">

</head>
<body ms-controller="UI_KSRESULT"> 
    <div class="page-group" style="background:#fff;"> 
        <div class="page">
            <!-- 标题栏 -->
            <header class="bar bar-nav" id="bar">
                <a class="icon icon-left pull-left external"></a>
                <h1 class="title">{{SJModelInfo.SJName}}</h1>
            </header>
            <!-- 工具栏 -->
            <nav class="bar bar-tab">
                <a class="tab-item external active" ms-click="SetSTIndex(-1)" ms-if="stindex!=0">
                    <i class="iconfont icon-jtleft mr5"></i>上一题
                </a>
                <a class="tab-item external">

                </a>
                <a class="tab-item external active" ms-click="SetSTIndex(-2)" ms-if="stindex!=SJModelInfo.STLIST.size()-1">
                    下一题<i class=" iconfont icon-jtright ml5">
                    </i>
                </a>
            </nav>
            <!-- 这里是页面内容区 -->
            <div class="content">
                <header class="bar bar-nav" style="background:#20affe;">
                    <h1 class="title" style="padding:0 1rem;">
                        <span class="pull-left" id="hid"> </span>
                        <span class="pull-right" id="dtk">答题卡 {{YZTCount}}/{{SJModelInfo.XTCount}}</span>
                    </h1>
                </header>
                <div class="exambox">
                    <p>【{{SJModelInfo.STLIST[stindex].STType}}】</p>
                    <div>{{SJModelInfo.STLIST[stindex].Order}}.{{SJModelInfo.STLIST[stindex].QContent|html}}({{SJModelInfo.STLIST[stindex].Record}}分)&nbsp;得分：{{SJModelInfo.STLIST[stindex].Record}}分</div>
                    <div class="list-block media-list">
                        <ul style="background: TRANSPARENT;" ms-if="SJModelInfo.STLIST[stindex].STType=='单选题'||SJModelInfo.STLIST[stindex].STType=='多选题'||SJModelInfo.STLIST[stindex].STType=='判断题'">
                            <li ms-repeat-qitem="SJModelInfo.STLIST[stindex].QItem">
                                <label class="label-checkbox item-content">
                                    <input ms-attr-type="SJModelInfo.STLIST[stindex].STType=='多选题'?'checkbox':'radio'" name="my-radio" ms-attr-checked="qitem.isselect" >
                                    <div class="item-media"><i class="icon icon-form-checkbox"></i></div>
                                    <div class="item-inner">
                                        <div>{{qitem.ItemName|html}}、 {{qitem.ItemDesc|html}}</div>
                                    </div>
                                </label>
                            </li>
                        </ul>
                        <!-- 填空题输入框 -->
                        <div style="background:#fff;" ms-if="SJModelInfo.STLIST[stindex].STType!='单选题'&&SJModelInfo.STLIST[stindex].STType!='多选题'&&SJModelInfo.STLIST[stindex].STType!='判断题'">
                            <textarea placeholder="请输入您的答案" ms-duplex="SJModelInfo.STLIST[stindex].Answer"  ></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="answer-sheet" class="answer-sheet">
        <div class="answer-panel">
            <div ms-repeat-item="SJModelInfo.TXType">
                <p class="title-list">{{item.STType}}&nbsp; 共{{item.totalCount}}题</p>
                <ul class="overflow">
                    <li ms-repeat-el="item.STList" ms-click="SetSTIndex(el.Order)">
                        <div class="answer-title" ms-class-1="active:el.ItemArray[4]>0">
                            {{el.Order}}
                        </div>
                    </li>
                </ul>
            </div>

        </div>
    </div>
    <script src="/View_Mobile/JS/layer/layer.m.js"></script>
<script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.8/js/sm.min.js' charset='utf-8'></script>
<script type='text/javascript' src='//g.alicdn.com/msui/sm/0.5.8/js/sm-extend.min.js' charset='utf-8'></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
<script src="/View_Mobile/JS/touch/toucher.js"></script>
<script src="/View_Mobile/JS/avalon.mobile.min.js"></script>
<script src="/View_Mobile/JS/raty/jquery.raty.js?v=1.3"></script>
<script src="/View_Mobile/JS/ComFunJS.js?jsver=20160425"></script>
    <script type="text/javascript">
        $(function () {
            $.init();
            // 计算弹窗位置
            var h1 = document.getElementById("bar").offsetHeight;
            var h2 = window.innerHeight - h1 * 2;
            document.getElementById("answer-sheet").style.height = h2 + "px";
            document.getElementById("answer-sheet").style.top = h1 * 2 + "px";
            $("#dtk").click(function () {
                $("#answer-sheet").toggle();
            })
        });


    </script>
    <script>
        var model = avalon.define({
            $id: "UI_KSRESULT",
            SJModelInfo: {}, 
            YZTCount: 0,
            stindex: 0,
            ksapId: ComFunJS.getQueryString("ksapid", 4),
            numberData: ["一", "二", "三", "四", "五", "六", "七", "八"],
            GetKSPAGE: function () {
                $.getJSON('/API/VIEWAPI.ashx?Action=KSGL_GETMOBILEYJVIEW', { P2: model.ksapId, P1: '18739915661' }, function (result) {
                    if (result.ErrorMsg == "") {
                        var i = 1;
                        result.Result[0].TXType.forEach(function (item) {
                            item.STList.forEach(function (el) {
                                el.Order = i;
                                i++;
                            })
                        })
                        i = 1;
                        result.Result[0].STLIST.forEach(function (el) {
                            el.Order = i;
                            i++;
                            if (el.ksCount > 0) {
                                model.YZTCount++;
                            }
                        })
                        model.SJModelInfo = result.Result[0];
                        if (result.Result1) {
                            model.UserKSInfo = result.Result1; 
                        }
                        model.stindex = 0; 
                    }
                    else {
                        top.ComFunJS.AlertMsg(result.ErrorMsg);
                    }
                })
            },

            SetSTIndex: function (index) {
                if (index == -1) {
                    model.stindex--;

                } else if (index == -2) {
                    model.stindex++;
                } else {
                    model.stindex = index - 1;
                    $("#answer-sheet").hide();
                }
            }
        })
        avalon.ready(function () {
            model.GetKSPAGE();
        }) //# sourceURL=RESULT.js;
    </script>
</body>

</html>
